status: failed duration: 0.002s Captured stdout call ZPK: ((-3, -3), (-1, -1, -1, -1), 10) captured errors: ZPK = ((-3, -3), (-1, -1, -1, -1), 10) @pytest.mark.parametrize( "ZPK", [ (((), (-1,), 10)), (((), (-1, -2), 10)), ( ( (), ( -1, -1, ), 10, ) ), (((), (-1, -1, -2), 10)), (((), (-1, -1, -1), 10)), (((), (-1, -1, -1, -2), 10)), (((), (-1, -1, -1, -1), 10)), (((), (-1, -1, -1, -1, -2), 10)), (((-3,) * 1, (-1,), 10)), (((-3,) * 1, (-1, -2), 10)), ( ( (-3,) * 1, ( -1, -1, ), 10, ) ), (((-3,) * 1, (-1, -1, -2), 10)), (((-3,) * 1, (-1, -1, -1), 10)), (((-3,) * 1, (-1, -1, -1, -2), 10)), (((-3,) * 1, (-1, -1, -1, -1), 10)), (((-3,) * 1, (-1, -1, -1, -1, -2), 10)), (((-3,) * 2, (-1,), 10)), (((-3,) * 2, (-1, -2), 10)), ( ( (-3,) * 2, ( -1, -1, ), 10, ) ), (((-3,) * 2, (-1, -1, -2), 10)), (((-3,) * 2, (-1, -1, -1), 10)), (((-3,) * 2, (-1, -1, -1, -2), 10)), (((-3,) * 2, (-1, -1, -1, -1), 10)), (((-3,) * 2, (-1, -1, -1, -1, -2), 10)), (((-3,) * 3, (-1, -2), 10)), (((-3,) * 4, (-1, -2), 10)), (((-3,) * 5, (-1, -2), 10)), (((-3,) * 6, (-1, -2), 10)), (((-3,) * 7, (-1, -2), 10)), (((-3,) * 8, (-1, -2), 10)), ], ) def test_residues(ZPK): print("ZPK: ", ZPK) > r_sci, zpk_sci = ZPK2residues_scipy(ZPK) ../../src/wield/control/fitting/SISO/test/residues/test_residues.py:80: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ZPK = ((-3, -3), (-1, -1, -1, -1), 10), F_nyquist_Hz = None def ZPK2residues_scipy( ZPK, F_nyquist_Hz=None, ): """ Useful for testing """ residue_list = [] b, a = scisig.zpk2tf(*ZPK) if F_nyquist_Hz is None: r, p, k = scisig.residue(b, a) else: r, p, k = scisig.residuez(b, a) # some indexing tricks to change the output to the form above same = p[1:] == p[:-1] same_adj = np.concatenate([[False], same, [False]]) same_shift = ~(same_adj[1:] | same_adj[:-1]) same_starts = ~same_adj[:-1] & same_adj[1:] same_ends = same_adj[:-1] & ~same_adj[1:] # the addition of same_adj puts all of the non-multiple back in for idx_start, idx_end in zip( np.argwhere(same_starts | same_shift), np.argwhere(same_ends | same_shift) ): idx_start = int(idx_start) idx_end = int(idx_end) pole = p[idx_start] res = r[idx_start : idx_end + 1] residue_list.append((pole,) + tuple(res)) if len(k) < 2: > return residue_list, ((), (), k[0]) E IndexError: index 0 is out of bounds for axis 0 with size 0 ../../src/wield/control/fitting/SISO/representations/residues.py:310: IndexError